package edu.bit.water.service;

import java.sql.SQLSyntaxErrorException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.BadSqlGrammarException;
import org.springframework.stereotype.Service;

import edu.bit.water.dao.MetaWaterAssociationDao;
import edu.bit.water.entity.MetaWater;

@Service
public class MetaWaterAssociationService {

	@Autowired
	private MetaWaterAssociationDao metaWaterAssociationDao;

	/**
	 *
	 * @param metaWater 元数据设备实体类
	 * @return 成功返回1，失败返回0
	 * @throws SQLSyntaxErrorException
	 */
	public int insertMetaWaterAssociation(MetaWater metaWater)  throws BadSqlGrammarException{
		int n = metaWaterAssociationDao.insertMetaWaterAsscoiation(metaWater);
		return n;
	}
	/**
	 *
	 * @param metaWater 元数据设备实体类
	 * @return 成功返回1，失败返回0
	 */
	public int deleteMetaWaterAssociation(MetaWater metaWater) {
		int n = metaWaterAssociationDao.deleteMetaWaterAsscoiation(metaWater);
		return n;
	}
}
